<template>
  <div>
    <h1>axios</h1>
    <button @click="getFun">get请求</button>
    <button @click="postFun">post请求</button>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    getFun() {
      console.log(this.$axios);

      this.$axios({
          method:"get",
          url:"http://api.app.yami.byesame.com/prod/tag/prodTagList",
          params:{
              //get传参使用params
          //   page:1
          },
      }).then((res)=>{
          console.log(res)
      })
    //   this.$axios
    //     .get("http://api.app.yami.byesame.com/prod/tag/prodTagList")
    //     .then((res) => {
    //       console.log(res);
    //     });
    },
    postFun() {
      this.$axios({
        method: "post",
        url: "https://www.zongheng.com/bookapi/updateList",
        data: {
          serialStatus: 0,
          cate: 0,
          level: 0,
        },
      }).then((res) => {
        console.log(res);
      });
      this.$axios
        .post("https://www.zongheng.com/bookapi/updateList", {
          serialStatus: 0,
          cate: 0,
          level: 0,
        })
        .then((res) => {
          console.log(res);
        });
    },
  },
};
</script>

<style>
</style>